home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / liferea / xslt / feed.xml.in next >
Encoding:
Extensible Markup Language  |  2010-07-19  |  6.3 KB  |  185 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!--
  4. /**
  5.  * Rendering stylesheet for Liferea (feed description view)
  6.  *
  7.  * Copyright (C) 2006-2007 Lars Lindner <lars.lindner@gmail.com>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version. 
  13.  *
  14.  * This program is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  * GNU General Public License for more details.
  18.  *
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; if not, write to the Free Software
  21.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  22.  */
  23. --> 
  24.  
  25. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  26.                 xmlns="http://www.w3.org/1999/xhtml">
  27.  
  28. <xsl:output method="xml" version="1.0" indent="yes"/>
  29.  
  30. <xsl:preserve-space elements="//*"/>
  31.  
  32. <xsl:template match="/feed" >
  33. <html xmlns="http://www.w3.org/1999/xhtml">
  34. <head>
  35. <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
  36. ##STYLE_INSERT##
  37. </head>
  38. <body>
  39.  
  40. <!-- error header tables -->
  41. <xsl:if test="parseError or filterError or updateError or httpError or feedDiscontinued = '1'">
  42. <div id='errors'>
  43.  
  44. <xsl:if test="feedDiscontinued = '1'">
  45.   <div id='updateError'>
  46.      <_span>This feed is discontinued. It's no longer available. Liferea won't update it anymore but you can still access the cached headlines.</_span>
  47.   </div>
  48. </xsl:if>
  49.  
  50. <xsl:if test="updateError">
  51.   <div id='updateError'>
  52.     <xsl:value-of select="updateError"/>
  53.   </div>
  54. </xsl:if>
  55.  
  56. <xsl:if test="httpError">
  57.   <div id='httpError'>
  58.     <_span>The last update of this subscription failed!<br/><b>HTTP error code <xsl:value-of select="httpErrorCode"/>: <xsl:value-of select="httpError"/></b></_span>    
  59.   </div>
  60. </xsl:if>
  61.  
  62. <xsl:if test="parseError">
  63.   <div id='parseError'>
  64.     <_span>There were errors while parsing this feed!</_span>
  65.  
  66.     <span id="pdl" class="detaillink">
  67.       (<span class="showmore" onclick="javascript:document.getElementById('pd').style.visibility='visible';document.getElementById('pd').style.display='block';document.getElementById('pdl').style.visibility='hidden';document.getElementById('pdl').style.display='none';">
  68.         <_span>Parser Error Details</_span>
  69.       </span>)
  70.     </span>
  71.  
  72.     <span class="details" id='pd'>
  73.       <b><_span>Details</_span></b><br />
  74.       <xsl:value-of select="parseError" disable-output-escaping='yes'/>
  75.       <script language="javascript" type="text/javascript">document.getElementById('pdl').style.visibility='visible';document.getElementById('pdl').style.display='inline';</script>
  76.  
  77.        <br /><_span>You may want to validate the feed using</_span>
  78.        <xsl:text> </xsl:text>
  79.        <a href="http://feedvalidator.org/check.cgi?url={feedSource}">FeedValidator</a>
  80.     </span>
  81.   </div>
  82. </xsl:if>
  83.  
  84. <xsl:if test="filterError">
  85.   <div id='filterError'>
  86.     <_span>There were errors while filtering this feed!</_span>
  87.  
  88.     <span id="fdl" class="detaillink">
  89.       (<span class="showmore" onclick="javascript:document.getElementById('fd').style.visibility='visible';document.getElementById('fd').style.display='block';document.getElementById('fdl').style.visibility='hidden';document.getElementById('fdl').style.display='none';">
  90.         <_span>Filter Error Details</_span>
  91.       </span>)
  92.     </span>
  93.  
  94.     <span class="details" id='fd'>
  95.       <b><_span>Details</_span></b><br />
  96.       <xsl:value-of select="filterError" disable-output-escaping='yes'/>
  97.       <script language="javascript" type="text/javascript">document.getElementById('fdl').style.visibility='visible';document.getElementById('fdl').style.display='inline';</script>
  98.     </span>
  99.   </div>
  100. </xsl:if>
  101.  
  102. </div>
  103. </xsl:if>
  104.  
  105. <!-- header table -->
  106. <table class="feedhead" cellspacing="0">
  107. <tr>
  108.   <td valign="middle" class="headleft">
  109.     <b><_span>Feed:</_span></b>
  110.   </td>
  111.   <td width="100%" valign="middle" class="headright">
  112.      <a href="{attributes/attribute[ @name = 'homepage' ]}">
  113.         <xsl:value-of select="feedTitle"/>
  114.      </a>
  115.   </td>
  116. </tr>
  117. <tr>
  118.   <td valign="middle" class="headleft">
  119.     <b><_span>Source:</_span></b>
  120.   </td>
  121.   <td width="100%" valign="middle" class="headright">
  122.      <xsl:variable name="href">
  123.         <xsl:call-template name="strippwd">
  124.            <xsl:with-param name="string" select="feedSource"/>
  125.         </xsl:call-template>
  126.      </xsl:variable>
  127.      <a href="{$href}">
  128.         <xsl:call-template name="strippwd">
  129.            <xsl:with-param name="string" select="feedSource"/>
  130.         </xsl:call-template>
  131.      </a>
  132.   </td>
  133. </tr>
  134. </table>
  135.  
  136. <!-- header metadata (author, copyright, language) -->
  137. <table class='headmeta' cellspacing="0" cellpadding="0">
  138. <xsl:if test="attributes/attribute[ @name = 'publisher' ]">
  139. <tr>
  140.  <td valign="top" class='publisher'>
  141.      <b><_span>Publisher</_span></b>
  142.      <span class='publisher'>
  143.        <xsl:value-of select="attributes/attribute[ @name = 'publisher' ]" disable-output-escaping='yes'/>
  144.      </span>
  145.  </td>
  146. </tr>
  147. </xsl:if>
  148. <xsl:if test="attributes/attribute[ @name = 'copyright' ]">
  149. <tr>
  150.  <td valign="top" class='copyright'>
  151.      <b><_span>Copyright</_span></b>
  152.      <span class='copyright'>
  153.        <xsl:value-of select="attributes/attribute[ @name = 'copyright' ]" disable-output-escaping='yes'/>
  154.      </span>
  155.  </td>
  156. </tr>
  157. </xsl:if>
  158. </table> <!-- end of header metadata -->
  159.  
  160. <div class='content'>
  161.  
  162. <xsl:if test="attributes/attribute[ @name = 'imageUrl' ]">
  163. <p>
  164. <img class="feed" src="{attributes/attribute[ @name = 'imageUrl' ]}"/>
  165. </p>
  166. </xsl:if>
  167.  
  168.    <xsl:value-of select="attributes/attribute[@name = 'description']" disable-output-escaping='yes'/>
  169.  
  170.    <xsl:value-of select="attributes/attribute[@name = 'textInput']" disable-output-escaping='yes'/>
  171. </div>
  172.  
  173. </body>
  174. </html>
  175. </xsl:template>
  176.  
  177. <xsl:template name="strippwd">
  178.    <xsl:param name="string"/>
  179.    <xsl:choose>
  180.        <xsl:when test="contains($string, '@')"><xsl:value-of select="substring-before($string, '://')"/>://<xsl:value-of select="substring-after($string, '@')"/></xsl:when>
  181.        <xsl:otherwise><xsl:value-of select="$string"/></xsl:otherwise>
  182.    </xsl:choose>
  183. </xsl:template>
  184. </xsl:stylesheet>
  185.